import HorizontalPlatform
import pygame
image1=pygame.image.load("spikyplate.jpg")
image1.set_colorkey((137,44,75))
image2=pygame.image.load("spikyplate_.jpg")
image2.set_colorkey((137,44,75))
import IntervalWorkingDevice

class SpikyPlate(IntervalWorkingDevice.IntervalWorkingDevice, HorizontalPlatform.HorizontalPlatform):
	def __init__(self,pos=(0,0),im=image1,im_=image2,intervals=[10,10],c_interval=0,c_time=1,off=False):
		HorizontalPlatform.HorizontalPlatform.__init__(self,pos=pos,image=im)
		self.image_=im_
		IntervalWorkingDevice.IntervalWorkingDevice.__init__(self,intervals=intervals,c_interval=c_interval,c_time=c_time,off=off)
	def drawingInformation(self):
		if self.cur_interval==0:
			return self.pos,self.image
		return [self.pos[0],self.pos[1]+self.image_.get_height()-self.image.get_height()],self.image_
	def hasFallenOff_y(self,objecto):
		HorizontalPlatform.HorizontalPlatform.hasFallenOff_y(self,objecto)
		if objecto in self.boundedList and not objecto.hangsFromButtom and self.cur_interval==1:
			objecto.die()